﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using NextAction.Domain.Entities;
using NextAction.Domain.Concrete;

namespace NextAction.Domain.Entities
{
    public static class BucketTypeExtensions
    {
        public static GtdTaskType GetGtdTaskType(this BucketType bucketType)
        {
            switch (bucketType)
            {
                case BucketType.Inbox:
                    return GtdTaskType.Inbox;
                case BucketType.Next:
                case BucketType.Today:
                case BucketType.Tomorrow:
                case BucketType.Scheduled:
                    return GtdTaskType.Next;
                case BucketType.Wait:
                    return GtdTaskType.Wait;
                case BucketType.Someday:
                    return GtdTaskType.Someday;
                default:
                    return GtdTaskType.Inbox;
            }
        }

        public static DateTime? GetScheduleDate(this BucketType bucketType)
        {
            switch (bucketType)
            {
                case BucketType.Today:
                    return DateTime.Today;
                case BucketType.Tomorrow:
                    return DateTime.Today.AddDays(1);
                default:
                    return null;
            }
        }

        public static ScheduleFilter GetScheduleFilter(this BucketType bucketType)
        {
            switch (bucketType)
            {
                case BucketType.Today:
                    return ScheduleFilter.Today;
                case BucketType.Tomorrow:
                    return ScheduleFilter.Tomorrow;
                case BucketType.Scheduled:
                    return ScheduleFilter.Scheduled;
                default:
                    return ScheduleFilter.NotScheduled;
            }
        }

    }
}